package com.link.base.base.serviceprojectnew.dao.mybatis.mapper;

import com.link.base.base.user.model.User;
import com.link.base.base.serviceprojectnew.model.ProjectReport;
import com.link.base.base.serviceprojectnew.model.ServiceProject;
import com.link.base.base.serviceprojectnew.model.PendingTaskReport;
import com.link.core.basic.dao.mapper.BasicMapper;

import java.util.List;

/**
 * @author unknown
 * @date unknown
 * @comments 项目信息
 */
public interface ServiceProjectMapper extends BasicMapper<ServiceProject> {
    /**
     * 查询项目员工列表
     *
     * @param user
     * @return 项目员工列表
     * @throws Exception
     */
    public List<User> queryProjSrproUserPage(User user) throws Exception;

    /**
     * 查询项目负责人列表
     *
     * @param sp
     * @return 项目员工列表
     * @throws Exception
     */
    public List<User> queryProjRespUserPage(ServiceProject sp) throws Exception;

    /**
     * 根据状态查询项目管理报表
     *
     * @param sp
     * @return List ProjectReport
     * @throws Exception
     */
    public List<ProjectReport> queryProjStatusReportPage(ServiceProject sp) throws Exception;

    /**
     * 查询项目列表
     *
     * @param t
     * @return List ProjectReport
     * @throws Exception
     */
    public List<ServiceProject> queryPublishTasksList(ServiceProject t) throws Exception;

    /**
     * 更新
     *
     * @param sp
     * @throws Exception
     */
    public void ServiceProjectPubStatusUpdate(ServiceProject sp) throws Exception;

    /**
     * 查询项目状态
     *
     * @param t
     * @return List ProjectReport
     * @throws Exception
     */
    public List<ProjectReport> ServiceProjectStatusSum(ServiceProject t) throws Exception;

    /**
     *  从任务反馈新建任务
     *
     *  @author      jiangtao
     *  @date        2019/3/7 上午9:40
     *  @param       t
     */
    public void insertMission(ServiceProject t) throws Exception;

    /**
     * 根据任务分组统计任务数量
     *
     * @author xieyuqiang
     * @date 2019/3/27 15:21
     */
    List<ServiceProject> groupTaskNumberByStatus(ServiceProject t) throws Exception;

    /**
     * 根据提出人统计任务数量
     *
     * @author xieyuqiang
     * @date 2019/3/27 15:21
     */
    int countByIntroducer(ServiceProject t) throws Exception;

    /**
     * 根据负责人统计任务数量
     *
     * @author xieyuqiang
     * @date 2019/3/27 15:21
     */
    int countByLiablePerson(ServiceProject t) throws Exception;

    /**
     * 统计待处理的任务数量（任务状态为新建、已分配、进行中、开发完成、待测试、测试不通过的任务为待处理任务）
     * 返回提出人和负责人的全部待处理任务数量、即将延期待处理任务数量、已延期待处理任务数量
     *
     * @author xieyuqiang
     * @date 2019/3/28 10:20
     */
    List<PendingTaskReport> countByEndDtAndUser() throws Exception;
}
